package repository

import "shyxy-model-agent/core/model"

type ModelInfoRepository interface {
	Repository
	Create(modelInfo *model.ModelInfo) (uint, error)
	FindOneByName(name string) (*model.ModelInfo, error)
	FindOneByID(id uint) (*model.ModelInfo, error)
	FindListByCategory(category string) ([]*model.ModelInfo, error)
	UpdateStatusByID(id uint, status string) error
	FindListByStatusAndName(name string, status ...string) ([]*model.ModelInfo, error)
	FindListAll() ([]*model.ModelInfo, error)
	DeleteByID(id uint) error
}

type OnlineModelRepository interface {
	Repository
	Create(onlineModel *model.OnlineModel) error
	FindOneByModelInfoID(modelInfoID uint) (*model.OnlineModel, error)
	FindOneByModelInfoIDWithModelInfo(modelInfoID uint) (*model.OnlineModel, error)
	DeleteByModelInfoID(modelInfoID uint) error
}

type SelfBuildModelRepository interface {
	Repository
	Create(selfBuildModel *model.SelfBuildModel) error
	FindOneByModelInfoID(modelInfoID uint) (*model.SelfBuildModel, error)
	FindOneByModelInfoIDWithModelInfo(modelInfoID uint) (*model.SelfBuildModel, error)
	DeleteByModelInfoID(modelInfoID uint) error
}

type GrpcInstanceRepository interface {
	Repository
	Create(instance *model.GrpcInstance) error
	FindListByStatusAndModelName(modelName string, status ...string) ([]*model.GrpcInstance, error)
}

type ModelContainerInstanceRepository interface {
	Repository
	Create(instance *model.ModelContainerInstance) error
	FindListByStatusAndModelName(modelName string, status ...string) ([]*model.ModelContainerInstance, error)
}
